<template>
	<view class="record">
		<!-- <navCom navName="提现记录" @previous="previous"></navCom> -->
		<view class="detlias_list my-pdlr-15" v-if="dev.length > 0">
			<view class="bor" v-for="(item,index) in dev" :key="index">
				<view class="detlias_list_txt">
					<view class="txt">
						<text class="my-mgr-15">提现</text>
					</view>
					<view class="time">{{item.createDate}}</view>
				</view>
				<view class="detlias_list_num my-pdl-10">
					<view class="fir num_red num_black">{{item.amount.toFixed(2)|| 0}}</view>
					<view class="two">{{item.withdrawalStatus}}</view>
				</view>
			</view>
		</view>
		<view style="width: 100%;height: 300rpx;text-align: center;line-height: 300rpx;" v-else>暂无数据</view>
	</view>
</template>

<script>
	import navCom from "@/components/navCom/navCom.vue";
	import { paginationApi } from "@/api/home.js"
	export default {
		components: {
			navCom,
		},
		data() {
			return {
				pageIndex:0,
				pageSize:30,
				total:1,
				dev:[],
			};
		},
		// 上拉加载更多
		onReachBottom() {
			this.getData()
		},
		onLoad() {
			this.getData()
		},
		methods:{
			async getData(){
				if (this.dev.length >= this.total) return
				let params = {
					pageIndex:this.pageIndex,
					pageSize:this.pageSize
				}
				uni.showLoading({
					title:"正在加载中...."
				})
				const res = await paginationApi(params)
				if(res.statusCode === 200){
					uni.hideLoading()
					this.dev = [...this.dev,...res.data.data.rows]
					this.total = res.data.data.total
					this.pageIndex++
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.record{
		width: 100%;
		height: 100vh;
		background: #FFFFFF;
		.detlias_list{
			width: 100%;
			height: 150rpx;
			.bor{
				width: 100%;
				height: 100%;
				display: flex;
				align-items: center;
				border-bottom: 1rpx solid #F2F2F2;
			}
			.detlias_list_txt{
				width: 70%;
				height: 100%;
				.txt,.time{
					width: 100%;
					height: 50%;
					
				}
				.txt{
					font-size: 32rpx;
					font-weight: 500;
					color: #333333;
					display: flex;
					align-items: center;
					padding-top: 20rpx;
				}
				.time{
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
					line-height: 55rpx;
				}
			}
			.detlias_list_num{
				width: 30%;
				height: 100%;
				text-align: right;
				.fir{
					line-height: 85rpx;
					font-size: 30rpx;
					font-weight: 500;
				}
				.fir,.two{
					width: 100%;
					height: 50%;
					
				}
				.two{
					line-height: 43rpx;
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
				}
			}
			.num_red{
				color: #F05329;
			}
			.num_black{
				color: #000000;
			}
		}
	}
</style>
